<h3 class="text-center" style="margin-bottom: 20px; font-size: 20px;">{{ 'app.passport.register' | translate }}</h3>
<div *ngIf="!result.show">
  <sf #sf mode="edit" [schema]="schema" [button]="null">
    <ng-template sf-template="Password" let-me>
      <nz-input-group nzSize="large" nzPrefixIcon="unlock">
        <input
          nz-input
          type="password"
          [ngModel]="me.formProperty.value"
          (ngModelChange)="passwordChange(me, $event)"
          placeholder="请输入新密码"
        />
      </nz-input-group>
    </ng-template>
    <ng-template sf-template="ConfirmPassword" let-me>
      <nz-input-group nzSize="large" nz-popover nzPrefixIcon="lock">
        <input
          nz-input
          type="password"
          [ngModel]="me.formProperty.value"
          (ngModelChange)="confirmPasswordChange(me, $event)"
          placeholder="请输入确认密码"
        />
      </nz-input-group>
    </ng-template>
    <ng-template sf-template="VerifyCode" let-me>
      <nz-input-group nzSize="large" [nzSuffix]="suffixButton" style="width: 200px;">
        <input
          nz-input
          [ngModel]="me.formProperty.value"
          (ngModelChange)="verifyCodeChange(me, $event)"
          placeholder="验证码"
          minlength="4"
        />
      </nz-input-group>
      <ng-template #suffixButton>
        <div style="text-align: right; cursor: pointer;">
          <img (click)="refreshCode()" [src]="code.image" />
        </div>
      </ng-template>
    </ng-template>
    <button nz-button nzType="primary" type="submit" nzSize="large" (click)="submit(sf.value)" [disabled]="!sf.valid" style="width: 50%;">
      注册
    </button>
    <a [routerLink]="['/passport/login']" style="float: right;"> 登录已有账号 </a>
  </sf>
</div>
<result *ngIf="result.show" type="{{ result.type }}" [title]="result.title" description="{{ result.description }}">
  <button nz-button [nzType]="'primary'" (click)="result.show = false; dto.VerifyCode = null">返回</button>
  <button *ngIf="result.type == 'success'" nz-button (click)="itcore.openMailSite(dto.Email)">进入邮箱</button>
  <button nz-button (click)="router.navigate(['home'])">返回首页</button>
</result>
